{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <style>
        /* 基础样式重置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        #container {
            width: 1000px;
            height: 560px;
            margin: 0 auto;
            background-image: url('{% static "images/bg.png" %}');
            background-position: center center;
        }
        div.login {
            width: 280px;
            padding: 30px 10px 50px;
            margin-left: 600px;
            margin-top: 120px;  /* 增加margin-top的值，进一步下移 */
            background-color: rgba(0, 0, 0, .3);
        }
        div.login table {
            width: 100%;
        }
        div.login tr td h4 {
            padding: 8px 2px;
            color: #fff;
        }
        .uname, .upwd {
            width: 100%;
            height: 37px;
            border: none;
            margin: 5px 0;
            background-repeat: no-repeat;
            background-position: 97% center;
            padding-right: 40px;
            box-sizing: border-box;
        }
        #btn {
            width: 100%;
            height: 27px;
            background-color: #00bfff; /* 天蓝色 */
            color: white;
            border: none;
            cursor: pointer;
        }
        .error-message {
            color: red;
            font-size: 12px;
            text-align: center;
            margin-top: 5px;
            display: {% if error_message %} block {% else %} none {% endif %};
        }
    </style>
</head>
<body>
    <div id="container">
        <div class="login">
            <form method="POST">
                {% csrf_token %}
                <table>
                    <tr>
                        <td><h4>用户登录</h4></td>
                    </tr>
                    <tr>
                        <td><input id="username" class="upwd" type="text" name="username" placeholder="请输入账户"></td>
                    </tr>
                    <tr>
                        <td><input id="password" class="upwd" type="password" name="password" placeholder="请输入密码"></td>
                    </tr>
                    <tr>
                        <td><div id="errorMessage" class="error-message">{{ error_message }}</div></td>
                    </tr>
                    <tr>
                        <td><input id="btn" type="submit" value="登录"></td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</body>
</html>
